﻿
<div ms-controller="tmpmodelview">
    <div class="control-group">
        <label class="control-label v-top">
            <b style="color: #f00;">*</b>
            手机号：
        </label>
        <div class="controls">
            <input type="text" class="input-xlarge input-xfat" ms-duplex="ModelData.Telephone" maxlength="20">
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            昵称：
        </label>
        <div class="controls">
            <input type="text" class="input-xlarge input-xfat" ms-duplex="ModelData.NickName" maxlength="20">
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            真实姓名：
        </label>
        <div class="controls">
            <input type="text" class="input-xlarge input-xfat" ms-duplex="ModelData.TrueName" maxlength="20">
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            密码：
        </label>
        <div class="controls">
            <input type="text" class="input-xlarge input-xfat" ms-duplex="ModelData.Password" maxlength="20">
            <span>密码为空即不修改密码</span>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            用户类型：
        </label>
        <div class="controls">
            <select class="input-large input-xfat" ms-duplex="ModelData.UserType">
                <option value="1">普通会员</option>
                <option value="2">VIP会员</option>
                <option value="3">鉴定专家</option>
            </select>
        </div>
    </div>
</div>

<script type="text/javascript">
    var tempmodel = avalon.define({
        $id: "tmpmodelview",
        ModelData: { "ID": "0", "Telephone": "", "UserType": "1", "Password": "", "TrueName": "", "NickName": "" },
        CateList:[],
        Init: function (ID) {
            if (ID) {
                $.getJSON("/adapi/user/model/" + ID, function (r) {
                    if (r.error == "") {
                        tempmodel.ModelData = r.result;
                    }

                })
            }
        },
        tmpSaveData: function () {

            $.post("/adapi/user/add", tempmodel.ModelData.$model, function (r) {
                if (r.error == "") {
                    top.ComFunJS.winShowMsg("操作成功");
                    top.ComFunJS.close();
                } else {
                    top.ComFunJS.winShowAlert(r.error);
                }

            })
        }

    });


</script>
